#!/bin/bash

version=1.1.5

#make sure armcord is uninstalled
if package_installed armcord ;then
  killall armcord &>/dev/null
  sudo apt purge -fy armcord
fi

#move config over from armcord to legcord
if [ -d ~/.config/armcord ] && [ ! -d ~/.config/legcord ];then
  mv ~/.config/armcord ~/.config/legcord
elif [ -d ~/.config/ArmCord ] && [ ! -d ~/.config/legcord ];then
  mv ~/.config/ArmCord ~/.config/legcord
fi

install_packages "https://github.com/Legcord/Legcord/releases/download/v${version}/Legcord-${version%-*}-linux-armv7l.deb" || exit 1
